All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sun.server.Service

java.lang.Object
   |
   +----sun.server.Service

public abstract class Service
extends Object
implements Runnable
An abstract class for implementing network services that manage multiple connection handler threads.


Variable Index

 o avail
The number of handler threads waiting for connections.
 o defaultServiceConfig
Default service configuration.
 o handlers
The thread group for handler threads.
 o maxThreads
Maximum number of handler threads.
 o minThreads
Minimum number of handler threads.
 o params
The parameters for this service.
 o port
The service port number.
 o serviceConfig
Service configuration for this service.
 o serviceRoot
Service root directory.
 o shutdown
Set to true when service shutdown is in progress.
 o shutdownComplete
Set to true when service shutdown is complete.
 o timeout
Handler thread timeout.
 o total
The total number of handler threads.
 o useNative
Set to true if native library support is available.

Constructor Index

 o Service()
Creates a new service with default parameters.
 o Service(ServiceParameters)

Method Index

 o createHandler()
Creates a new connection handler.
 o error(String)
Issues a non-fatal error message and returns.
 o error(String, Exception)
Issues a non-fatal error message with exception trace and returns.
 o fatal(String)
Issues a fatal (non-recoverable) error message and then exits.
 o fatal(String, Exception)
Issues a fatal (non-recoverable) error message with exception trace and then exits.
 o getAvailableHandlerThreads()
Returns available handler threads for this service.
 o getConfiguration()
Get the configuration for the service.
 o getDefaultConfiguration()
Get the default configuration for the service.
 o getEndpoint()
Returns the connection endpoint object, which is used to configure transport level protocol features of this service.
 o getServiceParameters()
Returns the parameters for this service.
 o getServiceRoot()
Returns service root directory.
 o getTotalHandlerThreads()
Returns total handler threads for this service.
 o init(ServiceConfiguration, ServiceConfiguration)
Initializes the service with specified configuration.
 o inShutdown()
Returns true if this service is in the process of a shutdown.
 o isShutdownComplete()
Returns true if this service has completed its shutdown.
 o prepareForStartup()
Prepare the service for starting.
 o run()
Starts the service.
 o shutdown()
Initiates service shutdown.
 o waitJeevesEvent()
Blocks until the Jeeves Event is triggered.

Variables

 o serviceRoot
 protected String serviceRoot
Service root directory.

 o handlers
 protected ThreadGroup handlers
The thread group for handler threads.

 o minThreads
 protected int minThreads
Minimum number of handler threads.

 o maxThreads
 protected int maxThreads
Maximum number of handler threads.

 o timeout
 protected long timeout
Handler thread timeout.

 o port
 public int port
The service port number.

 o avail
 protected int avail
The number of handler threads waiting for connections.

 o total
 protected int total
The total number of handler threads.

 o shutdown
 protected volatile boolean shutdown
Set to true when service shutdown is in progress.

 o shutdownComplete
 protected boolean shutdownComplete
Set to true when service shutdown is complete.

 o params
 protected ServiceParameters params
The parameters for this service.

 o useNative
 protected static boolean useNative
Set to true if native library support is available.

 o serviceConfig
 protected ServiceConfiguration serviceConfig
Service configuration for this service.

 o defaultServiceConfig
 protected ServiceConfiguration defaultServiceConfig
Default service configuration.

Constructors

 o Service
 protected Service(ServiceParameters params)
 o Service
 protected Service()
Creates a new service with default parameters.

Methods

 o getEndpoint
 public synchronized ConnectionEndpoint getEndpoint() throws ConfigurationException
Returns the connection endpoint object, which is used to configure transport level protocol features of this service. A given service may operate over different transport level protocols, or using more than one transport access point, as encapsulated through connection endpoint objects.

At this time only one endpoint is supported per service; this is in the "endpoint" group.

Throws: ConfigurationException
when the configuration parameters have illegal values
 o init
 protected abstract void init(ServiceConfiguration configuration,
                              ServiceConfiguration defaultConfiguration) throws ConfigurationException
Initializes the service with specified configuration.

Throws: ConfigurationException
indicates that the service was given illegal configuration information
 o prepareForStartup
 protected void prepareForStartup()
Prepare the service for starting. Called from ServerProcess when the service is about to be restarted.

 o run
 public void run()
Starts the service. Will return when service has been stopped.

 o createHandler
 protected abstract ServiceHandler createHandler()
Creates a new connection handler.

Returns:
the handler object
 o getServiceParameters
 public ServiceParameters getServiceParameters()
Returns the parameters for this service.

 o getTotalHandlerThreads
 public int getTotalHandlerThreads()
Returns total handler threads for this service.

 o getAvailableHandlerThreads
 public int getAvailableHandlerThreads()
Returns available handler threads for this service.

 o shutdown
 protected synchronized void shutdown()
Initiates service shutdown.

 o inShutdown
 public boolean inShutdown()
Returns true if this service is in the process of a shutdown.

 o isShutdownComplete
 public synchronized boolean isShutdownComplete()
Returns true if this service has completed its shutdown.

 o error
 protected void error(String s)
Issues a non-fatal error message and returns.

Parameters:
s - the error message
 o error
 protected void error(String s,
                      Exception e)
Issues a non-fatal error message with exception trace and returns.

Parameters:
s - the error message
e - the error exception
 o fatal
 protected void fatal(String s)
Issues a fatal (non-recoverable) error message and then exits.

Parameters:
s - the error message
 o fatal
 protected void fatal(String s,
                      Exception e)
Issues a fatal (non-recoverable) error message with exception trace and then exits.

Parameters:
s - the error message
e - the error exception
 o getConfiguration
 protected ServiceConfiguration getConfiguration()
Get the configuration for the service.

Returns:
the service's configuration.
 o getDefaultConfiguration
 protected ServiceConfiguration getDefaultConfiguration()
Get the default configuration for the service.

Returns:
the service's default configuration.
 o getServiceRoot
 public String getServiceRoot()
Returns service root directory.

Returns:
the service's root.
 o waitJeevesEvent
 public native void waitJeevesEvent()
Blocks until the Jeeves Event is triggered. The thread invoking this method should invoke the shutdown() method on returning from this method.


All Packages  Class Hierarchy  This Package  Previous  Next  Index